home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / cmds.fmt / find.man < prev    next >
Encoding:
Text File  |  1989-01-02  |  6.7 KB  |  199 lines

  1.  
  2.  
  3.  
  4. FIND                      User Commands                      FIND
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      find - find files
  10.  
  11. SSYYNNOOPPSSIISS
  12.      ffiinndd pathname-list expression
  13.      ffiinndd pattern
  14.  
  15. DDEESSCCRRIIPPTTIIOONN
  16.      In the first form above, _f_i_n_d recursively descends the
  17.      directory hierarchy for each pathname in the _p_a_t_h_n_a_m_e-_l_i_s_t
  18.      (i.e., one or more pathnames) seeking files that match a
  19.      boolean _e_x_p_r_e_s_s_i_o_n written in the primaries given below.  In
  20.      the descriptions, the argument _n is used as a decimal
  21.      integer where +_n means more than _n, -_n means less than _n and
  22.      _n means exactly _n.
  23.  
  24.      The second form rapidly searches a database for all path-
  25.      names which match _p_a_t_t_e_r_n.  Usually the database is recom-
  26.      puted weekly and contains the pathnames of all files which
  27.      are publicly accessible.  If escaped, normal shell "glob-
  28.      bing" characters (`*', `?', `[', and ']') may be used in
  29.      _p_a_t_t_e_r_n, but the matching differs in that no characters
  30.      (_e._g. `/') have to be matched explicitly.  As a special
  31.      case, a simple _p_a_t_t_e_r_n containing no globbing characters is
  32.      matched as though it were *_p_a_t_t_e_r_n*; if any globbing charac-
  33.      ter appears there are no implicit globbing characters.
  34.  
  35.      --nnaammee filename
  36.                True if the _f_i_l_e_n_a_m_e argument matches the current
  37.                file name.  Normal shell argument syntax may be
  38.                used if escaped (watch out for `[', `?' and `*').
  39.  
  40.      --ppeerrmm onum
  41.                True if the file permission flags exactly match
  42.                the octal number _o_n_u_m (see _c_h_m_o_d(1)).  If _o_n_u_m is
  43.                prefixed by a minus sign, more flag bits (017777,
  44.                see _s_t_a_t(2)) become significant and the flags are
  45.                compared: (_f_l_a_g_s&_o_n_u_m)==_o_n_u_m.
  46.  
  47.      --ttyyppee c   True if the type of the file is _c, where _c is bb,,
  48.                cc,, dd,, ff,, ll or ss for block special file, character
  49.                special file, directory, plain file, symbolic
  50.                link, or socket.
  51.  
  52.      --lliinnkkss n  True if the file has _n links.
  53.  
  54.      --uusseerr uname
  55.                True if the file belongs to the user _u_n_a_m_e (login
  56.                name or numeric user ID).
  57.  
  58.      --nnoouusseerr   True if the file belongs to a user _n_o_t in the
  59.                /etc/passwd database.
  60.  
  61.  
  62.  
  63. Sprite v1.0               May 11, 1986                          1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. FIND                      User Commands                      FIND
  71.  
  72.  
  73.  
  74.      --ggrroouupp gname
  75.                True if the file belongs to group _g_n_a_m_e (group
  76.                name or numeric group ID).
  77.  
  78.      --nnooggrroouupp  True if the file belongs to a group _n_o_t in the
  79.                /etc/group database.
  80.  
  81.      --ssiizzee n   True if the file is _n blocks long (512 bytes per
  82.                block).
  83.  
  84.      --iinnuumm n   True if the file has inode number _n.
  85.  
  86.      --aattiimmee n  True if the file has been accessed in _n days.
  87.  
  88.      --mmttiimmee n  True if the file has been modified in _n days.
  89.  
  90.      --eexxeecc command
  91.                True if the executed command returns a zero value
  92.                as exit status.  The end of the command must be
  93.                punctuated by an escaped semicolon.  A command
  94.                argument `{}' is replaced by the current pathname.
  95.  
  96.      --ookk command
  97.                Like --eexxeecc except that the generated command is
  98.                written on the standard output, then the standard
  99.                input is read and the command executed only upon
  100.                response yy.
  101.  
  102.      --pprriinntt    Always true; causes the current pathname to be
  103.                printed.
  104.  
  105.      --llss       Always true; causes current pathname to be printed
  106.                together with its associated statistics.  These
  107.                include (respectively) inode number, size in kilo-
  108.                bytes (1024 bytes), protection mode, number of
  109.                hard links, user, group, size in bytes, and modif-
  110.                ication time.  If the file is a special file the
  111.                size field will instead contain the major and
  112.                minor device numbers.  If the file is a symbolic
  113.                link the pathname of the linked-to file is printed
  114.                preceded by ``->''.  The format is identical to
  115.                that of ``ls -gilds'' (note however that format-
  116.                ting is done internally, without executing the ls
  117.                program).
  118.  
  119.      --nneewweerr file
  120.                True if the current file has been modified more
  121.                recently than the argument _f_i_l_e.
  122.  
  123.      --ccppiioo file
  124.                Write the current file on the argument _f_i_l_e in
  125.                _c_p_i_o format.
  126.  
  127.  
  128.  
  129. Sprite v1.0               May 11, 1986                          2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. FIND                      User Commands                      FIND
  137.  
  138.  
  139.  
  140.      --xxddeevv     Always true; causes find _n_o_t to traverse down into
  141.                a file system different from the one on which
  142.                current _a_r_g_u_m_e_n_t pathname resides.
  143.  
  144.      The primaries may be combined using the following operators
  145.      (in order of decreasing precedence):
  146.  
  147.      1)  A parenthesized group of primaries and operators
  148.          (parentheses are special to the Shell and must be
  149.          escaped).
  150.  
  151.      2)  The negation of a primary (`!' is the unary _n_o_t opera-
  152.          tor).
  153.  
  154.      3)  Concatenation of primaries (the _a_n_d operation is implied
  155.          by the juxtaposition of two primaries).
  156.  
  157.      4)  Alternation of primaries (`--oo' is the _o_r operator).
  158.  
  159. EEXXAAMMPPLLEESS
  160.      To find all accessible files whose pathname contains `find':
  161.  
  162.           find find
  163.  
  164.      To typeset all variants of manual pages for `ls':
  165.  
  166.           vtroff -man `find '*man*/ls.?'`
  167.  
  168.      To remove all files named `a.out' or `*.o' that have not
  169.      been accessed for a week:
  170.  
  171.        find / \( -name a.out -o -name '*.o' \) -atime +7 -exec rm
  172.        {} \;
  173.  
  174. FFIILLEESS
  175.      /etc/passwd
  176.      /etc/group
  177.      /usr/lib/find/find.codes     coded pathnames database
  178.  
  179. SSEEEE AALLSSOO
  180.      sh(1), test(1), fs(5)
  181.      Relevant paper in February, 1983 issue of ;_l_o_g_i_n:.
  182.  
  183. BBUUGGSS
  184.      The first form's syntax is painful, and the second form's
  185.      exact semantics is confusing and can vary from site to site.
  186.  
  187.      More than one `-newer' option does not work properly.
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195. Sprite v1.0               May 11, 1986                          3
  196.  
  197.  
  198.  
  199.